﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ScheduleMaker.DB.Domain.Core;

namespace ScheduleMaker.DB.Domain
{
    public class ClassroomSchool : Classroom
    {
        private int id;
        private string name;
        private string description;
        private Iesi.Collections.Generic.ISet<Equipment> equiments;
        IList<Schedule> schedule;

        public virtual int Id
        {
            get { return id; }
            set { id = value; }
        }

        public virtual string Name
        {
            get { return name; }
            set { name = value; }
        }

        public virtual string Description
        {
            get { return description; }
            set { description = value; }
        }

        public virtual Iesi.Collections.Generic.ISet<Equipment> Equipments
        {
            get { return equiments; }
            set { equiments = value; }
        }

        public virtual void addEquipment(Equipment eq)
        {
            if (!equiments.Contains(eq))
            {
                equiments.Add(eq);
            }
        }

        IList<Schedule> Schedule
        {
            get { return schedule; }
            set { schedule = value; }
        }

        public override bool Equals(object obj)
        {
            if (obj == null)
                return false;
            var t = obj as ClassroomSchool;
            if (t == null)
                return false;
            if (Id == t.Id
                && Name == t.Name
                && Description == t.Description)
                return true;
            return false;
        }

        public override int GetHashCode()
        {
            return (Id + "|"
                + Name + "|"
                + Description).GetHashCode();
        }

    }
}
